<?php
	
	/*
	 	Script that runs all automatic tests.
	*/
	
	/* Includes */
	require_once "../Login/LoginHandler.php";
	require_once "../FileUpload/FileUploadHandler.php";
	require_once "../Registration/RegistrationHandler.php";
	require_once "../Database/Database.php";
	
	// Instances of the classes to be tested
	$lh = new LoginHandler();
	$fuh = new FileUploadHandler();
	//$rh = new RegistrationHandler();
	$db = new Database();
	
	// Run the Databse test
	$config = new DBConfig("test_db");
	
	if (!$db::Test($config))
		echo "<div>Database test failed.</div>";
	else
		echo "<div>Database test succeeded.</div>";
	
	// Run the loginhandler test
	if (!$lh::Test())
		echo "<div>Loginhandler test failed.</div>";
	else
		echo "<div>Loginhandler test succeeded.</div>";
	
	// Run the fileuploadhandler test
	if (!$fuh::Test())
		echo "<div>Fileuploadhandler test failed.</div>";
	else
		echo "<div>Fileuploadhandler test succeeded.</div>";
	
	// Run the fileuploadhandler test
	/*if (!$rh::Test($db))
		echo "<div>RegistrationHandler test failed.</div>";
	else
		echo "<div>RegistrationHandler test succeeded.</div>";*/